cmake_minimum_required(VERSION 3.16)
project(HexConverter)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_SKIP_RPATH ON)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)

add_definitions(-D_UNICODE -DUNICODE -DQSCINTILLA_DLL)

file(GLOB UI_SRC ${PROJECT_SOURCE_DIR}/*.ui)
file(GLOB SRC ${PROJECT_SOURCE_DIR}/*.cpp)
file(GLOB MOC_HEADER ${PROJECT_SOURCE_DIR}/*.h)
file(GLOB RES ${PROJECT_SOURCE_DIR}/*.qrc)

add_library(${PROJECT_NAME} SHARED ${SRC} ${UI_SRC} ${MOC_HEADER} ${RES})

target_include_directories(${PROJECT_NAME} PRIVATE
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/../../include
${PROJECT_SOURCE_DIR}/../../qscint/src
${PROJECT_SOURCE_DIR}/../../qscint/src/Qsci
${PROJECT_SOURCE_DIR}/../../qscint/scintilla/src
${PROJECT_SOURCE_DIR}/../../qscint/scintilla/include
${PROJECT_SOURCE_DIR}/../../qscint/scintilla/lexlib
${PROJECT_SOURCE_DIR}/../../qscint/scintilla/boostregex
)
target_link_directories(${PROJECT_NAME} PRIVATE
	../../x64/${CMAKE_BUILD_TYPE}
	../../../build/${CMAKE_BUILD_TYPE}
	../../../build/src/qscint/${CMAKE_BUILD_TYPE}
)

target_link_libraries(${PROJECT_NAME} qscint Qt5::Core Qt5::Gui Qt5::Widgets)
